"""
所有页面类的基类
"""
from config.config_login import HOST

class BasePage:

    def __init__(self, driver):
        self.driver = driver
        self.url = "http://{}{}".format(HOST, self.url)

    def open(self):
        """打开当前页面"""
        self.driver.get(self.url)

    def find_element(self, locator):
        """根据传递的定位器，查找元素"""
        return self.driver.find_element(*locator)


"""
用例基类
"""
import unittest

from tools.tools_two.driver import chrome


class BaseCase(unittest.TestCase):

    def setUp(self) -> None:
        self.driver = chrome()

    def tearDown(self) -> None:
        self.driver.quit()